package com.zhanghe.study.design_pattern.composite_pattern;

/**
 * 抽象组件
 * @author zh
 * @date 2022/10/15 18:15
 */
public abstract class Component {

    // 业务方法
    public abstract void doSomething();

    // 添加子节点，默认实现
    public void addChild(Component child){
        throw new UnsupportedOperationException();
    }

    // 移除子节点，默认实现
    public void removeChild(Component child){
        throw new UnsupportedOperationException();
    }

    // 获取子节点，默认实现
    public Component getChild(int index){
        throw new UnsupportedOperationException();
    }
}
